import omit from 'omit.js';

export interface BaseProps {

    width?: number; // 长度

    height?: number; // 高度

    className?: string;

    children?: any;

    style?: React.CSSProperties;

    disabled?: boolean;

}

export const BaseHelper = {
    concatStyle: (props: any) => {
        let _style = {
            ...props.style
        }
        if (props.width) {
            _style = {
                ..._style,
                width: props.width + 'px'
            }
        }
        if (props.height) {
            _style = {
                ..._style,
                height: props.height + 'px'
            }
        }
        return _style;
    },
    getPrefixCls: (type: string) => {
        return 'keda-' + type;
    },
    omit: (obj, arr?: Array<string>) => {
        let _arr = arr || ['width', 'height', 'className', 'children', 'style']
        return omit(obj, _arr);
    },
    defalutOmitKeyArr: ['width', 'height', 'className', 'children', 'style']

}

